<?php
/**
 * Created by JetBrains PhpStorm.
 * User: thinhhung
 * Date: 5/24/12
 * Time: 3:11 PM
 * To change this template use File | Settings | File Templates.
 */
?>
<h1 align="center">DANH MỤC ĐỐI TƯỢNG KHÁCH HÀNG</h1>
<?php
echo $this->Html->link('Thêm đối tượng khách hàng', array('controller' => 'doi_tuong_k_hs', 'action' => 'add'), array('class' => 'lk'));
echo "<br /><br />";
?>
<table>
    <tr>
        <th><?php echo $this->Paginator->sort('MADT', 'MÃ ĐỐI TƯỢNG'); ?></th>
        <th><?php echo $this->Paginator->sort('TENDT', 'TÊN ĐỐI TƯỢNG'); ?></th>

        <th>THAY ĐỔI</th>
    </tr>

    <?php foreach ($doituongkhs as $doituongkh): ?>
    <tr>
        <td><?php echo $doituongkh['DoiTuongKH']['MADT']; ?></td>
        <td><?php echo $doituongkh['DoiTuongKH']['TENDT']; ?></td>


        <td><?php
            if ($this->Session->read('quyen') != 'nhanvien') {
                echo $this->Html->link('Sửa', array('action' => 'edit', $doituongkh['DoiTuongKH']['id']));
            }  else echo '&nbsp';?>
            <?php
            if ($this->Session->read('quyen') == 'quantri') {
            echo $this->Form->PostLink('Xóa', array('action' => 'delete', $doituongkh['DoiTuongKH']['id']),
                array('confirm' => 'Bạn có chắc chắn muốn xóa?'));
               }?>
        </td>
    </tr>
    <?php endforeach; ?>
</table>

<div id="pagination">
    <div class="paging">
        <?php echo $this->Paginator->first('Trang đầu'); ?>
        <?php echo $this->Paginator->prev('<<' . __('Lùi', true),
        array(), null, array('class' => 'disabled')); ?>
        <?php echo $this->Paginator->numbers(); ?>
        <?php echo $this->Paginator->next(__('Tới', true) . '>>',
        array(), null, array('class' => 'disabled')); ?>
        <?php echo $this->Paginator->last('Trang cuối'); ?>
    </div>
</div>
<br/><br/>
<?php
echo $this->Html->link('Thêm đối tượng khách hàng', array('controller' => 'doi_tuong_k_hs', 'action' => 'add'), array('class' => 'lk'));
?>

<div id="Ltrangchu" align="center">
    <?php
    echo $this->Html->link('TRANG CHỦ', array('controller' => ''));
    ?>
</div>
